package com.dacong.nezha.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dacong.nezha.domain.Active;
import com.dacong.nezha.domain.CodeServerList;
import com.dacong.nezha.domain.ServerList;
import com.dacong.nezha.mapper.ActiveMapper;
import com.dacong.nezha.mapper.CodeServerListMapper;
import com.dacong.nezha.mapper.ServerListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServerListService extends ServiceImpl<ServerListMapper, ServerList> {

    @Autowired
    CodeServerListMapper codeServerListMapper;

    public List<CodeServerList> getByCode(String code){
        List<CodeServerList> codeServerLists = codeServerListMapper
                .selectList(new LambdaQueryWrapper<CodeServerList>()
                        .eq(CodeServerList::getCode, code));
        return codeServerLists;
    }

}
